from selenium import webdriver
import unittest
import sys, time
#from xmlrunner import *

class ExampleTestCase(unittest.TestCase):

    capabilities = None
    def setUp(self):
        self.driver = webdriver.Remote(desired_capabilities={
        "browserName": browser,
        "platform": platform,
        "node":port })
    
    def test_example(self):
        self.driver.get("http://www.360logica.com")
        time.sleep(4)
        #self.assertEqual(self.driver.title, "360logica")
        
    def tearDown(self):
        self.driver.quit()

if __name__ == "__main__":
    args = sys.argv
    port = args[1]
    platform = args[2]
    browser = args[3]
    suite = unittest.TestSuite()
    suite.addTest(ExampleTestCase('test_example'))
#    runner = XMLTestRunner(file('results_ExampleTestCase_%s.xml' % (browser), "w"))
    #runner.run(suite())
    runner = unittest.TextTestRunner()
    runner.run(suite)